Skip to content

Conversation

@mschofie
Copy link
Member

@mschofie mschofie commented Jul 15, 2025

Description

The QnnEpFactory implementation currently initializes the underlying provider by passing the backend_type configuration as htp, causing the provider to find the appropriate backend-library, and load it relative to the OnnxRuntime library. But if EP's are distributed separately from the OnnxRuntime library - a major benefit of the EP ABI - then the backend-library may-well not be relative to the OnnxRuntime. Having the QnnEpFactory implementation look for its associated runtime relative to itself would allow the implementation to bring its own runtime - and that's what this PR enables.

If the QnnEpFactory implementation is co-located with the OnnxRuntime library, then this is consistent with the existing behavior, but an QnnEpFactory implementation that is shipped 'out-of-band' will use a backend-relative to itself.

WinML has been using a version of this fix, and this PR is 'upstreaming' the change.

Motivation and Context

To support out-of-band distribution of EP's - enabled by the EP ABI work - then EP's should accommodate finding dependencies relative to the EP library, and not the OnnxRuntime library.

nieubank
nieubank previously approved these changes Jul 15, 2025
@jywu-msft
Copy link
Member

build error for building as shared lib

@mschofie
Copy link
Member Author

build error for building as shared lib

Sorry... I assumed an MSVC-ism. Will fix shortly.

jywu-msft
jywu-msft previously approved these changes Jul 17, 2025
@jywu-msft jywu-msft dismissed their stale review July 17, 2025 21:04

found merge issues

@jywu-msft
Copy link
Member

@adrianlizarraga @skottmckay can you take a quick look at this?

@jywu-msft jywu-msft added the ep:QNN issues related to QNN exeution provider label Jul 18, 2025
@jywu-msft
Copy link
Member

conflict with #25456

@jywu-msft
Copy link
Member

conflict with #25456

I resolved the merge conflict. pls confirm it looks ok.

@mschofie
Copy link
Member Author

conflict with #25456

I resolved the merge conflict. pls confirm it looks ok.

Looks good, thanks.

@adrianlizarraga adrianlizarraga merged commit ca45ff2 into main Jul 21, 2025
90 checks passed
@adrianlizarraga adrianlizarraga deleted the mschofie/qnn-path branch July 21, 2025 17:22
@snnn
Copy link
Member

snnn commented Jul 25, 2025

Hi there! We haven't cut the release branch for this version yet, so I'm removing the release:1.23.0 label for now to keep things tidy. Thanks so much for your contribution! We'll make sure this gets included when the release is prepared. 🤖

qti-yuduo pushed a commit to CodeLinaro/onnxruntime that referenced this pull request Aug 8, 2025
…icrosoft#25407)

### Description
The `QnnEpFactory` implementation currently initializes the underlying
provider by passing the `backend_type` configuration as `htp`, causing
the provider to find the appropriate backend-library, and load it
relative to the OnnxRuntime library. But if EP's are distributed
separately from the OnnxRuntime library - a major benefit of the EP ABI
- then the backend-library may-well not be relative to the OnnxRuntime.
Having the `QnnEpFactory` implementation look for its associated runtime
relative to _itself_ would allow the implementation to bring its own
runtime - and that's what this PR enables.

If the `QnnEpFactory` implementation is co-located with the OnnxRuntime
library, then this is consistent with the existing behavior, but an
`QnnEpFactory` implementation that is shipped 'out-of-band' will use a
backend-relative to itself.

WinML has been using a version of this fix, and this PR is 'upstreaming'
the change.

### Motivation and Context
To support out-of-band distribution of EP's - enabled by the EP ABI work
- then EP's should accommodate finding dependencies relative to the EP
library, and not the OnnxRuntime library.

---------

Co-authored-by: George Wu <[email protected]>
sanketkaleoss pushed a commit to sanketkaleoss/onnxruntime that referenced this pull request Aug 11, 2025
…icrosoft#25407)

### Description
The `QnnEpFactory` implementation currently initializes the underlying
provider by passing the `backend_type` configuration as `htp`, causing
the provider to find the appropriate backend-library, and load it
relative to the OnnxRuntime library. But if EP's are distributed
separately from the OnnxRuntime library - a major benefit of the EP ABI
- then the backend-library may-well not be relative to the OnnxRuntime.
Having the `QnnEpFactory` implementation look for its associated runtime
relative to _itself_ would allow the implementation to bring its own
runtime - and that's what this PR enables.

If the `QnnEpFactory` implementation is co-located with the OnnxRuntime
library, then this is consistent with the existing behavior, but an
`QnnEpFactory` implementation that is shipped 'out-of-band' will use a
backend-relative to itself.

WinML has been using a version of this fix, and this PR is 'upstreaming'
the change.

### Motivation and Context
To support out-of-band distribution of EP's - enabled by the EP ABI work
- then EP's should accommodate finding dependencies relative to the EP
library, and not the OnnxRuntime library.

---------

Co-authored-by: George Wu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ep:QNN issues related to QNN exeution provider

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants